<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/3/15 0015
  Time: 11:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Bootstrap 101 Template</title>
    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>

    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <style type="text/css">
        .comment-content {
            display: block;
            width: 100%;
            padding: 7px 8px;
            background: #fff;
            border: 1px solid #c1c1c1;
            border-radius: 4px;
            resize: none;
            height: 38px;
            font-size: 14px;
            line-height: 22px;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            -webkit-transition: height .3s ease-in-out;
            transition: height .3s ease-in-out;
        }

        .btn-comment {
            margin: 0;
            margin-left: 16px;
        }

        .btn-red:hover {
            background-color: #f21f2b !important;
            border-color: #f21f2b !important;
        }

        .btn.btn-sm {
            margin-top: 6px;
            margin-bottom: 6px;
            height: 30px;
            line-height: 28px;
            min-width: 72px;
        }

        button, html input[type="button"], input[type="reset"], input[type="submit"] {
            -webkit-appearance: button;
            cursor: pointer;
        }

        [type=reset], [type=submit], button, html [type=button] {
            -webkit-appearance: button;
        }

        .btn-red {
            color: #fff !important;
            border: 1px solid #ca0c16 !important;
            background-color: #ca0c16 !important;
            -webkit-transition: background-color .1s ease-in-out, border-color .1s ease-in-out;
            transition: background-color .1s ease-in-out, border-color .1s ease-in-out;
        }

        .btn {
            margin-left: 8px;
            margin-right: 8px;
            margin-top: 6px;
            margin-bottom: 6px;
            padding: 0 8px;
            display: inline-block;
            font-size: 14px;
            border-radius: 4px;
            text-align: center;
            border: none;
            background-color: transparent;
            height: 34px;
            line-height: 32px;
            min-width: 72px;
            cursor: pointer;
        }

        button, input, optgroup, select, textarea {
            font-family: sans-serif;
            font-size: 100%;
            line-height: 1.15;
            margin: 0;
        }

        .comment-box .comment-list-container .comment-list-box ul.comment-list {
            margin-top: 8px;
            border-bottom: 1px dashed #e0e0e0;
        }
    </style>

</head>
<body>
<div>
    <jsp:include page="/WEB-INF/view/header.jsp"></jsp:include>
</div>
<div class="container-fluid">
    <div class="row">
        <div class="col-md-9 ">
            <div>
                <h3 style="color:red;text-align：center">${requestScope.article.getTitle()}</h3>
            </div>
            <p style="word-break:normal;white-space: pre-wrap;word-wrap: break-word;">
                ${requestScope.article.getContext()}
            </p>

            <div>
                <h1 style="color:red; font-size:20px;"> 评论</h1>
                <c:forEach var="i" begin="1" end="${requestScope.commentList.size()}">
                    <div class="col-md-10" style="line-height:35px">
                        <a class="navbar-link">
                            <li style="color:black"><font style="color:black; font-size:15px"></font><font
                                    style="color:black; font-size:15px">${requestScope.commentList.get(i-1).getCommentContent()}</font>
                        </a>
                    </div>
                </c:forEach>
            </div>
            <form action="${pageContext.request.contextPath}/Comment?articleId=${requestScope.article.getArticleId()}&userId=${requestScope.article.getUserId()}"
                  method="post">
                <input type="hidden" name="method" value="add">
                <textarea class="comment-content" name="comment_content" id="comment_content"
                          placeholder="想对作者说点什么"></textarea>
                <input type="submit" class="btn btn-sm btn-red btn-comment" value="发表评论">
            </form>
        </div>


        <div class="col-md-2" align="center" style="margin-left: 10px">
            <button type="button" class="btn btn-link" data-toggle="tooltip" data-placement="bottom" title="查看个人中心"
                    style="background-color: initial;">
                <a href="User?method=personal&userId=${requestScope.userId}">
                    <img src="${pageContext.request.contextPath}/images/touxiang_1.jpg" alt="Responsive image"
                         class="img-circle img-responsive" style="height: 100px;width: 100px">
                </a>
            </button>
            <br>
            <br>
            <br>
            <br>
            <label>用户Id：${requestScope.article.getUserId()}</label>

            <script>
                $(function () {
                    $("[data-toggle='tooltip']").tooltip();
                });
            </script>
        </div>
    </div>
</div>
</body>
</html>
